package com.safety51.bootstrap.demo.interfaces;

import com.safety51.bootstrap.demo.application.service.DomainEventExampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by liuyuancheng on 2021/9/29  <br/>
 *
 * @author liuyuancheng
 */
@RestController
@RequestMapping("")
public class DomainEventExampleController {

    @Autowired
    private DomainEventExampleService domainEventExampleService;

    @GetMapping("ping")
    public String ping(){
        domainEventExampleService.diPublish("pong");
        return "pong";
    }
}
